package com.sl.au.service;

import java.util.List;
import java.util.Map;

import org.activiti.engine.runtime.ProcessInstance;

import com.sl.au.entity.AfterSaleTicket;
import com.sl.au.entity.AfterSaleTicketAdvice;
import com.sl.au.entity.Contract;
import com.sl.au.repository.AfterSaleTicketAdviceRepository;
import com.sl.au.repository.AfterSaleTicketBackRepository;
import com.sl.au.repository.AfterSaleTicketRepository;

public interface AfterSaleTicketService extends BaseService {
     AfterSaleTicketRepository getTicketRepository();
     
     AfterSaleTicketBackRepository getBackRepository();
     
     AfterSaleTicketAdviceRepository getAdviceRepository();
     
/**
 * 根据key值得到afterSaleTicket数据
 * @param key 查询条件
 * @return
 */
	List<AfterSaleTicket> getAfterSaleTicket(int start, int length, Map<String,String>condition, String orderName, String dir);
	/**
	 * 得到afterSaleTicket数据条数
	 * @param condition 
	 * @return
	 */
	long getTicketCount(Map<String, String> condition);
 /**
  * 根据key值得到contract数据
  * @param key 查询条件
  * @return
  */
List<Contract> getContract(int start, int length, String key, String orderName, String dir);
void setAfterSaleTicketState(String ticketId,String auditState);
void saveProcessStart(String ticketId, ProcessInstance pInst);

/**通过票号得到advice
 * @param ticketId
 * @return
 * Neil
 */
AfterSaleTicketAdvice getTicketAdviceByTicketId(String ticketId);


	/**客户页面获取相关的售后信息
	 * @param key
	 * @param unitName
	 * @return
	 */
	List<AfterSaleTicket>geSaleTicketpage(int start,int length,String key,String customerId,String orderName,String dir);
	long getTicketCount(String key,String customerId);
}
